﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Profile_of_Staff.aspx.cs" Inherits="_Default" MasterPageFile="~/Admin/Administrator.master" Title = "Profile of Staff Page"%>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.2, Version=11.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.2, Version=11.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent" >
    <p>
        <dx:ASPxGridView ID="gvwStaffProfile" runat="server" 
            AutoGenerateColumns="False" CssFilePath="~/App_Themes/DevEx/{0}/styles.css" 
            CssPostfix="DevEx" DataSourceID="SqlDataSource1" KeyFieldName="StaffID" 
            Caption="List of Staff" Width="100%" 
            onrowvalidating="gvwStaffProfile_RowValidating" 
            ClientInstanceName="gvwStaffProfile">
            <Columns>
                <dx:GridViewCommandColumn VisibleIndex="0">
                    <EditButton Visible="True">
                    </EditButton>
                    <NewButton Visible="True">
                    </NewButton>
                    <DeleteButton Visible="True">
                    </DeleteButton>
                    <ClearFilterButton Text="Clear" Visible="True">
                    </ClearFilterButton>
                </dx:GridViewCommandColumn>
                <dx:GridViewDataTextColumn FieldName="StaffID" VisibleIndex="1">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Password" VisibleIndex="2">
                    <PropertiesTextEdit Password="True">
                    </PropertiesTextEdit>
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Firstname" VisibleIndex="3">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Lastname" VisibleIndex="4">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn FieldName="Gender" VisibleIndex="5">
                    <PropertiesComboBox IncrementalFilteringMode="Contains">
                        <Items>
                            <dx:ListEditItem Text="Male" Value="Male" />
                            <dx:ListEditItem Text="Female" Value="Female" />
                        </Items>
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataDateColumn FieldName="Birthdate" VisibleIndex="6">
                </dx:GridViewDataDateColumn>
                <dx:GridViewDataTextColumn FieldName="Address" VisibleIndex="7">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Phone" VisibleIndex="8">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Email" VisibleIndex="9">
                </dx:GridViewDataTextColumn>
            </Columns>
            <Settings ShowFilterRow="True" ShowStatusBar="Visible" />
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <AlternatingRow Enabled="True">
                </AlternatingRow>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
        </dx:ASPxGridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Institte_of_Fine_ArtsConnectionString %>" 
            InsertCommand="INSERT INTO Staff(StaffID, Password, Firstname, Gender, Lastname, Birthdate, Address, Phone, Email) VALUES (@StaffID, @Password, @Firstname, @Gender, @Lastname, @Birthdate, @Address, @Phone, @Email)" 
            SelectCommand="SELECT * FROM Staff" DeleteCommand="DELETE Work_Details WHERE StaffID =@StaffID
DELETE Staff WHERE StaffID=@StaffID" 
            UpdateCommand="UPDATE Staff SET StaffID = @StaffID, Password = @Password, Firstname = @Firstname, Lastname = @Lastname, Birthdate = @Birthdate, Gender = @Gender, Address = @Address, Phone = @Phone, Email = @Email WHERE (StaffID = @StaffID)">
            <DeleteParameters>
                <asp:Parameter Name="StaffID" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="StaffID" />
                <asp:Parameter Name="Password" />
                <asp:Parameter Name="Firstname" />
                <asp:Parameter Name="Lastname" />
                <asp:Parameter Name="Gender" />
                <asp:Parameter Name="Birthdate" />
                <asp:Parameter Name="Address" />
                <asp:Parameter Name="Phone" />
                <asp:Parameter Name="Email" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="StaffID" />
                <asp:Parameter Name="Password" />
                <asp:Parameter Name="Firstname" />
                <asp:Parameter Name="Lastname" />
                <asp:Parameter Name="Birthdate" />
                <asp:Parameter DefaultValue="" Name="Gender" />
                <asp:Parameter Name="Address" />
                <asp:Parameter Name="Phone" />
                <asp:Parameter Name="Email" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>